package com.knowledge.plus.设计模式.代理模式.静态代理;

/**
 * 代理类
 *
 * @author TPF
 * @since 2023/12/12
 */
class CinemaTicketAgent implements Ticket {

    private CinemaTicket cinemaTicket;

    public CinemaTicketAgent(CinemaTicket cinemaTicket) {
        this.cinemaTicket = cinemaTicket;
    }

    @Override
    public void buyTicket(String name, String time, String seat) {
        before();
        this.cinemaTicket.buyTicket(name, time, seat);
        after();
    }

    public void before() {
        System.out.println("-----选座位-----");
    }

    public void after() {
        System.out.println("-----付款-----");
    }
}